<?php

    /**
     * Tecdoc
     *
     * @package      Core
     * @subpackage   Installer
     *
     * @license      GNU Lesser General Public Licence see LICENCE-LGPL file or http://www.gnu.org/licenses/lgpl.html
     */
	abstract class Core_Installer_Adapter
	{

    ////////////////////////////////////////////////////////////////////////////
	//                                Constants                               //
	////////////////////////////////////////////////////////////////////////////

        const ADAPTER_HTACCESS  = 'htaccess';
        const ADAPTER_CONFIG    = 'config';
        const ADAPTER_IGNORE    = 'svnignore';
        const ADAPTER_FIXTURES  = 'fixtures';
        const ADAPTER_WSUPDATER = 'updater';

    ////////////////////////////////////////////////////////////////////////////
	//                                Static methods                          //
	////////////////////////////////////////////////////////////////////////////

        /**
         * Factory
         *
         * @param       string      $adapter
         * @throws      Core_Exception
         * @return      Core_Svn_Adapter_Abstract
         */
        public static function factory($adapter)
        {
            switch ($adapter) {
                case self::ADAPTER_HTACCESS:
                    return new Core_Installer_Adapter_Htaccess();

                case self::ADAPTER_CONFIG:
                    return new Core_Installer_Adapter_Config();

                case self::ADAPTER_IGNORE:
                    return new Core_Installer_Adapter_Ignore();

                case self::ADAPTER_FIXTURES:
                    return new Core_Installer_Adapter_Fixtures();
                    
                case self::ADAPTER_WSUPDATER:
                    return new Core_Installer_Adapter_Wsupdater();

                default:
                    throw new Core_Exception('Invalid adapter selected');
            }
        }
	}
